import {defineStore} from "pinia";

export  const useDialogStore = defineStore('loginDialog',{
    state: () => ({
         dialogVisible:false,
         dialogValue:'login'
    }),
    actions:{
        dialog(newValue){
                this.dialogVisible =newValue.dialogVisible;
                this.dialogValue = newValue.dialogValue;
        },
        handleClose(){
            this.dialogVisible = false;
        },
        openLoginDialog(){
            this.dialog({dialogVisible:true,dialogValue:'login'})
        },
        openRegisterDialog(){
            this.dialog({dialogVisible:true,dialogValue:'register'})
        }
    },
    getters:{

    }
})


